package com.ruoyi.hospital.service.prescriptionInfo.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.prescriptionInfo.PrescriptionAdvisedInfoMapper;
import com.ruoyi.hospital.domain.prescriptionInfo.PrescriptionAdvisedInfo;
import com.ruoyi.hospital.service.prescriptionInfo.IPrescriptionAdvisedInfoService;

/**
 * 建议处方单Service业务层处理
 * 
 * @author wendao
 * @date 2024-08-20
 */
@Service
public class PrescriptionAdvisedInfoServiceImpl implements IPrescriptionAdvisedInfoService 
{
    @Autowired
    private PrescriptionAdvisedInfoMapper prescriptionAdvisedInfoMapper;

    /**
     * 查询建议处方单
     * 
     * @param id 建议处方单主键
     * @return 建议处方单
     */
    @Override
    public PrescriptionAdvisedInfo selectPrescriptionAdvisedInfoById(Integer id)
    {
        return prescriptionAdvisedInfoMapper.selectPrescriptionAdvisedInfoById(id);
    }

    /**
     * 查询建议处方单列表
     * 
     * @param prescriptionAdvisedInfo 建议处方单
     * @return 建议处方单
     */
    @Override
    public List<PrescriptionAdvisedInfo> selectPrescriptionAdvisedInfoList(PrescriptionAdvisedInfo prescriptionAdvisedInfo)
    {
        return prescriptionAdvisedInfoMapper.selectPrescriptionAdvisedInfoList(prescriptionAdvisedInfo);
    }

    /**
     * 新增建议处方单
     * 
     * @param prescriptionAdvisedInfo 建议处方单
     * @return 结果
     */
    @Override
    public int insertPrescriptionAdvisedInfo(PrescriptionAdvisedInfo prescriptionAdvisedInfo)
    {
        prescriptionAdvisedInfo.setCreateTime(DateUtils.getNowTimeSecond());
        return prescriptionAdvisedInfoMapper.insertPrescriptionAdvisedInfo(prescriptionAdvisedInfo);
    }

    /**
     * 修改建议处方单
     * 
     * @param prescriptionAdvisedInfo 建议处方单
     * @return 结果
     */
    @Override
    public int updatePrescriptionAdvisedInfo(PrescriptionAdvisedInfo prescriptionAdvisedInfo)
    {
        prescriptionAdvisedInfo.setUpdateTime(DateUtils.getNowTimeSecond());
        return prescriptionAdvisedInfoMapper.updatePrescriptionAdvisedInfo(prescriptionAdvisedInfo);
    }

    /**
     * 批量删除建议处方单
     * 
     * @param ids 需要删除的建议处方单主键
     * @return 结果
     */
    @Override
    public int deletePrescriptionAdvisedInfoByIds(Integer[] ids)
    {
        return prescriptionAdvisedInfoMapper.deletePrescriptionAdvisedInfoByIds(ids);
    }

    /**
     * 删除建议处方单信息
     * 
     * @param id 建议处方单主键
     * @return 结果
     */
    @Override
    public int deletePrescriptionAdvisedInfoById(Integer id)
    {
        return prescriptionAdvisedInfoMapper.deletePrescriptionAdvisedInfoById(id);
    }
}
